import 'package:get/get.dart';

class BaseProvider extends GetConnect {
  @override
  void onInit() {
    // 接口地址
    httpClient.baseUrl = 'http://v.juhe.cn/';

    // 请求拦截器
    httpClient.addRequestModifier<void>((request) {
      // String token = 'YXVkIjoiaVlLmNvbyS4nr_0BH8yVhPkHzI';
      // request.headers['Authorization'] = "Bearer "+token;
      return request;
    });

    // 响应拦截器
    httpClient.addResponseModifier((request, response) {
      return response;
    });
  }
}
